/*
 * @Author: lininghua 0027012803@iwhalecloud.com
 * @Date: 2022-05-10 00:20:21
 * @LastEditors: lininghua 0027012803@iwhalecloud.com
 * @LastEditTime: 2022-06-13 15:02:56
 * @FilePath: /flowplatform-fe-sf/src/pages/flowmonitor/eventlist/components/EventColumns.jsx
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import React from "react";
import moment from "moment";
import styles from "./EventColumns.less";

const Columns = (handlePay1) => [
  {
    title: "事件名称",
    dataIndex: "name",
    render: (text) => {
      return <span>{text}</span>;
    },
  },
  {
    title: "模型编码",
    dataIndex: "modelKey",
    render: (text) => <span title={text}>{text}</span>,
  },
  {
    title: "模型名称",
    dataIndex: "modelName",
    render: (text) => {
      return <span>{text}</span>;
    },
  },
  {
    title: "事件类型",
    dataIndex: "eventType",
    render: (text) => {
      return <span>{text}</span>;
    },
  },
  {
    title: "流程实例id",
    dataIndex: "processInstanceId",
    render: (text) => {
      return <span>{text}</span>;
    },
  },
  {
    title: "节点编码",
    dataIndex: "nodeCode",
    render: (text) => {
      return <span>{text}</span>;
    },
  },
  {
    title: "请求URL",
    dataIndex: "callbackContent",
    render: (text) => <span title={text}>{text}</span>,
  },
  {
    title: "请求体",
    dataIndex: "requestBody",
    render: (text) => <span title={text}>{text}</span>,
  },
  {
    title: "异常信息",
    dataIndex: "exceptionMsg",
    render: (text) => <span title={text}>{text}</span>,
  },
  {
    title: "创建时间",
    dataIndex: "gmtCreate",
    render: (text) => {
      return <span>{moment(text).format("YYYY-MM-DD HH:mm:ss")}</span>;
    },
  },
  {
    title: "状态",
    dataIndex: "status",
    render: value => (value === "0" ? "未补偿" : "已补偿"),
  },
  {
    title: "操作",
    render: (_, record) => {
      return (
        <span>
          { record.status === "0" ? (
            <a className={styles.blue} onClick={() => handlePay1(record)}>
              补偿
            </a>
          )
             : ''}
        </span>
      );
    },
  },
];

export default Columns;
